home *** CD-ROM | disk | FTP | other *** search
-
-
-
- aaaallllllllooooccccbbbb((((DDDD3333)))) aaaallllllllooooccccbbbb((((DDDD3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- _aaaa_llll_llll_oooo_cccc_bbbb - allocate a message block
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_tttt_rrrr_eeee_aaaa_mmmm_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
- _mmmm_bbbb_llll_kkkk______tttt _****_aaaa_llll_llll_oooo_cccc_bbbb_((((_iiii_nnnn_tttt _s_i_z_e_,,,, _uuuu_iiii_nnnn_tttt______tttt _p_r_i_))))_;;;;
-
- AAAArrrrgggguuuummmmeeeennnnttttssss
- _s_i_z_e The number of bytes in the message block.
-
- _p_r_i Priority of the request.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _aaaa_llll_llll_oooo_cccc_bbbb tries to allocate a STREAMS message block.
-
- RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
- If successful, _aaaa_llll_llll_oooo_cccc_bbbb returns a pointer to the allocated message block of
- type _MMMM______DDDD_AAAA_TTTT_AAAA (defined in _ssss_yyyy_ssss_////_ssss_tttt_rrrr_eeee_aaaa_mmmm_...._hhhh). If a block cannot be allocated, a
- _NNNN_UUUU_LLLL_LLLL pointer is returned.
-
- UUUUSSSSAAAAGGGGEEEE
- Buffer allocation fails only when the system is out of memory. If no
- buffer is available, the _bbbb_uuuu_ffff_cccc_aaaa_llll_llll(D3) function can help a module recover
- from an allocation failure.
-
- The psi argument is no longer used, but is retained for compatibility.
-
- The following figure identifies the data structure members that are
- affected when a message block is allocated.
- ||||
- ________
- ||||
- ________
- ______
-
-
-
-
-
-
- __
-
- __
-
-
- |||
- _bbbb______cccc_oooo_nnnn_tttt _((((_0000_))))
- _bbbb______rrrr_pppp_tttt_rrrr
- _bbbb______wwww_pppp_tttt_rrrr
- _bbbb______dddd_aaaa_tttt_aaaa_pppp
- message block
- (_mmmm_bbbb_llll_kkkk______tttt)
- data block
- (_dddd_bbbb_llll_kkkk______tttt)
- data buffer
- ______
-
-
- ______
-
-
-
-
-
-
-
- ||||
- ____________
- ||||
- ____________
- ||||
- ______
- ||||
- ______
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- _____________________
- ||
-
- _dddd_bbbb______bbbb_aaaa_ssss_eeee
- _dddd_bbbb______llll_iiii_mmmm
- _dddd_bbbb______tttt_yyyy_pppp_eeee _((((_MMMM______DDDD_AAAA_TTTT_AAAA_))))
-
-
-
-
-
-
-
-
- LLLLeeeevvvveeeellll
- Base or Interrupt.
-
- SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
- Does not sleep.
-
- Driver-defined basic locks, read/write locks, and sleep locks may be held
- across calls to this function.
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- aaaallllllllooooccccbbbb((((DDDD3333)))) aaaallllllllooooccccbbbb((((DDDD3333))))
-
-
-
- EEEExxxxaaaammmmpppplllleeee
- Given a pointer to a queue (_q) and an error number (_e_r_r), the _ssss_eeee_nnnn_dddd______eeee_rrrr_rrrr_oooo_rrrr
- routine sends an _MMMM______EEEE_RRRR_RRRR_OOOO_RRRR type message to the stream head.
-
- If a message cannot be allocated, 0 is returned, indicating an allocation
- failure (line 8). Otherwise, the message type is set to _MMMM______EEEE_RRRR_RRRR_OOOO_RRRR (line
- 9). Line 10 increments the write pointer (_bbbb_pppp_----_>>>>_bbbb______wwww_pppp_tttt_rrrr) by the size (one
- byte) of the data in the message.
-
- A message must be sent up the read side of the stream to arrive at the
- stream head. To determine whether _q points to a read queue or a write
- queue, the _qqqq_----_>>>>_qqqq______ffff_llll_aaaa_gggg member is tested to see if _QQQQ_RRRR_EEEE_AAAA_DDDD_RRRR is set (line 12).
- If it is not set, _q points to a write queue, and on line 13 the _RRRR_DDDD(D3)
- function is used to find the corresponding read queue. In line 14, the
- _pppp_uuuu_tttt_nnnn_eeee_xxxx_tttt(D3) function is used to send the message upstream. Then
- _ssss_eeee_nnnn_dddd______eeee_rrrr_rrrr_oooo_rrrr returns 1 indicating success.
-
- _1111 _ssss_eeee_nnnn_dddd______eeee_rrrr_rrrr_oooo_rrrr_((((_qqqq_,,,, _eeee_rrrr_rrrr_))))
- _2222 _qqqq_uuuu_eeee_uuuu_eeee______tttt _****_qqqq_;;;;
- _3333 _uuuu_cccc_hhhh_aaaa_rrrr______tttt _eeee_rrrr_rrrr_;;;;
- _4444 _{{{{
- _5555 _mmmm_bbbb_llll_kkkk______tttt _****_bbbb_pppp_;;;;
- _6666 _llll_oooo_nnnn_gggg _ffff_llll_====_0000_;;;;
- _7777 _iiii_ffff _((((_((((_bbbb_pppp _==== _aaaa_llll_llll_oooo_cccc_bbbb_((((_1111_,,,, _BBBB_PPPP_RRRR_IIII______HHHH_IIII_))))_)))) _====_==== _NNNN_UUUU_LLLL_LLLL_))))
- _8888 _rrrr_eeee_tttt_uuuu_rrrr_nnnn_((((_0000_))))_;;;;
- _9999 _bbbb_pppp_----_>>>>_bbbb______dddd_aaaa_tttt_aaaa_pppp_----_>>>>_dddd_bbbb______tttt_yyyy_pppp_eeee _==== _MMMM______EEEE_RRRR_RRRR_OOOO_RRRR_;;;;
- _1111_0000 _****_bbbb_pppp_----_>>>>_bbbb______wwww_pppp_tttt_rrrr_++++_++++ _==== _eeee_rrrr_rrrr_;;;;
- _1111_1111 _((((_vvvv_oooo_iiii_dddd_)))) _ssss_tttt_rrrr_qqqq_gggg_eeee_tttt_((((_qqqq_,,,, _QQQQ_FFFF_LLLL_AAAA_GGGG_,,,, _0000_,,,, _&&&&_ffff_llll_))))_;;;;
- _1111_2222 _iiii_ffff _((((_ffff_llll _&&&& _QQQQ_RRRR_EEEE_AAAA_DDDD_RRRR_))))_))))
- _1111_3333 _qqqq _==== _RRRR_DDDD_((((_qqqq_))))_;;;;
- _1111_4444 _pppp_uuuu_tttt_nnnn_eeee_xxxx_tttt_((((_qqqq_,,,, _bbbb_pppp_))))_;;;;
- _1111_5555 _rrrr_eeee_tttt_uuuu_rrrr_nnnn_((((_1111_))))_;;;;
- _1111_6666 _}}}}
-
- RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
- _bbbb_uuuu_ffff_cccc_aaaa_llll_llll(D3), _eeee_ssss_bbbb_aaaa_llll_llll_oooo_cccc(D3), _eeee_ssss_bbbb_bbbb_cccc_aaaa_llll_llll(D3), _ffff_rrrr_eeee_eeee_bbbb(D3), _mmmm_ssss_gggg_bbbb(D4)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-